package top.sayto.simon.notificationlistener.ui.helper;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.DialogFragment;

import java.util.Objects;

import top.sayto.simon.notificationlistener.R;
import top.sayto.simon.notificationlistener.databinding.EditRuleDialogBinding;

public class AddRuleDialogFragment extends DialogFragment {

//    private EditRuleDialogBinding binding;

    @NonNull
    @Override
    public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
        View view = getLayoutInflater().inflate(R.layout.edit_rule_dialog, null);


        AlertDialog dialog = new AlertDialog.Builder(getActivity())
                .setView(view)
                .setPositiveButton(R.string.common_confirm, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int id) {
                        // 点击确定
                        dismiss();
                    }
                })
                .setNegativeButton(R.string.common_close, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int id) {
                        dismiss();
                    }
                })
                .create();

        return  dialog;
//        return super.onCreateDialog(savedInstanceState);
    }
}
